package ac.leedsmet.devmanager.core;

import java.util.LinkedList;
import java.util.List;

/**
 * @author Samael
 * @version 1.0
 */
public class UserManagerImpl implements UserManager {

    private static long userId = 100000L;
    private List<User> users = new LinkedList<User>();

    /**
     *  The method is giving an auto increment and unique id on any created user
     * @param username  username of the created user
     * @param password  password of the created user
     * @return  user object
     */
    public User createUser(String username, String password) {
        userId++;
        User user = new User(userId, username, password);
        users.add(user);
        return user;
    }

    /**
     * Returns a list of User objects
     * @return List<User> objects
     */
    public List<User> getUsers() {
        return users;
    }
}
